package com.huadragon.marathondao.dao.impl;





import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.huadragon.marathondao.base.BaseDao;
import com.huadragon.marathondao.dao.inter.IAccountInfoDao;
import com.huadragon.marathonentity.common.page.PagerModel;
import com.huadragon.marathonentity.servicedomain.AccountInfoDomain;

@Repository
public class AccountInfoDaoImpl implements IAccountInfoDao {
	@Autowired
	private BaseDao dao;

	public PagerModel selectPageList(AccountInfoDomain e) {
		return dao.selectPageList("AccountInfo.selectPageList",
				"AccountInfo.selectPageCount", e);
	}
	
	public AccountInfoDomain selectById(int id) {
		// TODO Auto-generated method stub
		return null;
	}

	public List selectList(AccountInfoDomain e) {
		return dao.selectList("AccountInfo.selectList", e);
	}

	public AccountInfoDomain selectOne(AccountInfoDomain e) {
		return (AccountInfoDomain) dao.selectOne("AccountInfo.selectOne", e);
	}

	public int delete(AccountInfoDomain e) {
		return dao.delete("AccountInfo.delete", e);
	}

	public int update(AccountInfoDomain e) {
		return dao.update("AccountInfo.update", e);
	}

	public int deletes(int[] ids) {
		AccountInfoDomain e = new AccountInfoDomain();
		for (int i = 0; i < ids.length; i++) {
			e.setId(ids[i]);
			delete(e);
		}
		return 0;
	}

	public int insert(AccountInfoDomain e) {
		return dao.insert("AccountInfo.insert", e);
	}

	public int deleteById(int id) {
		return dao.delete("AccountInfo.deleteById", id);
	}

	public int selectCount(AccountInfoDomain e) {
		return dao.getCount("AccountInfo.selectCount", e);
	}

	public int insertList(List<AccountInfoDomain> list) {
		// TODO Auto-generated method stub
		return 0;
	}
	
	@Override
	public int updateRoleID(AccountInfoDomain accountInfoDomain) {
		return dao.update("AccountInfo.updateRoleID", accountInfoDomain);
	}
	
}
